"""
下载文件
"""

from selenium import webdriver
import os

from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By

chrome_option = Options()
chrome_option.add_argument("browser.download.folderList")
extension = {"browser.download.folderList": 2,
             "browser.download.manager.showWhenStarting": False,
             "browser.download.dir": os.getcwd(),
             "browser.helperApps.neverAsk.saveToDisk": "application/octet-stream"}
chrome_option.add_extension(extension)

driver = webdriver.Chrome(chrome_options=chrome_option)
driver.get("http://pypi.Python.org/pypi/selenium")
driver.find_element(By.PARTIAL_LINK_TEXT, value="selenium-2").click()
